'use strict';
/**
 * logic
 * @param  {} []
 * @return {}     []
 */
import Base from './base.js';
export default class extends Base {
  /**
   * index action logic
   * @return {} []
   */
  indexAction(){

    // if(!this.checkUser()){
    //   return this.http.errMsg({error: 'No Access'});
    // }
    
    // if(!this.http.socket.user.cansend){
    //   return this.http.errMsg({error: 'Not Access Send Danmu'});
    // }

    let rules = { 
      subscribe  : "required|string",
      data       : "required|object"
    }

    let flag = this.validate(rules);
    
    if(!flag){
      return this.http.errMsg(this.errors());
    }

    if(think.isEmpty(this.http.data.data.content)){
      return this.http.errMsg({error: 'Content Is Empty'});
    }

  }
}
